-
Notifications
You must be signed in to change notification settings - Fork 927
docs: correct way to get the default module in examples #2425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is good to go, right? |
not really, only |
Yeah. we should revert this . And format has two way to require: const {format} = require('@commitlint/format')
// or
const format = require('@commitlint/format').default |
@armano2 sorry! I only test format api, I didn't dig into other api module's source code |
bdw, format is actually wierd, no clue why this is exported in this way commitlint/@commitlint/format/src/index.ts Lines 1 to 2 in 31818ea
thats most likely reason why we have issues with this, package |
@escapedcat Anyway, after revert. we are ready to go. using |
Looks like test file counts on index.ts, that's why we need index.ts. If we change it to
Am I right? @escapedcat @armano2 |
fix(syntax): CommonJS can't require default entry using this syntax sugar, so revert it This reverts commit 511c639.
@AdeAttwood maybe we can just merged this? |
@escapedcat yea I think merge this in, so the docs are correct. I do like the destructuring syntax but could not get that to work. I think looking into that will be cool. |
Thanks people! |
a walkaround for #2423, add
default
to all of the api module'srequire
method in example code